package models;

import play.db.jpa.GenericModel;
import play.db.jpa.Model;
import play.data.validation.Required;
import play.data.validation.MaxSize;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * Model OpcionMenu generated by Play!
 */

@Entity
@Table(name="OPCION_MENU")
public class OpcionMenu extends GenericModel {

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_OPCIONMENU")
	@SequenceGenerator(name="SEQ_OPCIONMENU", sequenceName="SEQ_OPCIONMENU", allocationSize=1)
	private long idopcion;
    @ManyToOne
    public OpcionMenu opcionMenu;
    @Required
    @MaxSize(20)
    public String nombreopcion;
    @Required
    @MaxSize(40)
    public String url;
    //@OneToMany(mappedBy="OPCION_MENU")  
    //public Set<RolOpcion> rolOpcions = new HashSet<RolOpcion>(0);
    //@OneToMany(mappedBy="OPCION_MENU")  
    //public Set<OpcionMenu> opcionMenus = new HashSet<OpcionMenu>(0);

    //default constructor 
    public OpcionMenu() {
    }
    public OpcionMenu(long idopcion) {
     	this.idopcion = idopcion;
    }
   


}


